package com.sunkyc.framework.utils;


import com.baomidou.mybatisplus.core.metadata.IPage;
import com.sunkyc.commons.entity.TablePageData;

public class TablePageDataBuilderUtil {
    public static <T> TablePageData<T> buildTablePageData(IPage<T> ipge) {
        TablePageData<T> tablePageData = new TablePageData<>();
        tablePageData.setCurrent(ipge.getCurrent()).setPageSize(ipge.getSize())
                .setPageTotal(ipge.getTotal()).setPages(ipge.getPages()).setRows(ipge.getRecords());
        return tablePageData;
    }

}
